-
Notifications
You must be signed in to change notification settings - Fork 238
Fix arrow functions inside ternary expressions #408
Fix arrow functions inside ternary expressions #408
Conversation
Uhm, what was wrong with my fix, exactly? |
There's no need to restrict #279's fix to |
This is a necessary step to recognize object keys. See #307 // for e.g.
switch() {
default:
}
a = {
default: 123
} |
Sigh... I see this was already discussed. In which case, I'll probably have to rebase against your branch, since I'm in the middle of fixing numerous bugs for another PR... |
@50Wliu Any chance of getting this merged soon? There'll be a new version of Linguist this week, and it'd be nice to have these highlighting bugs fixed on the site. Otherwise, they'll linger on GitHub for a few weeks longer. :p Just to be clear: once this and the other PR get merged, I'll go balls out on remaining bug fixes in the hopes of getting everything under the one release. =) /cc @pchaigno Paging you because @arfon won't hear me from where I'm standing. Literally (his name's not showing up in my mentions menu...). |
I am currently much busier than I was just a week ago, so expect my activity on GitHub to tank significantly for a while. I'll try to merge this to unblock your other PRs but those might sit for some time before proper review. |
'name': 'keyword.operator.ternary.js' | ||
'patterns': [ | ||
{ | ||
'match': '(\\w+)(?=\\s*:)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what this match does in more detail?
In addition, why is the second $self
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 157241d. There is no need to include $self
here. Though most of the rules must be moved to the repo and it also requires addition testing, so I kept it as is for now. The second $self
includes everything else between ?
and :
7296d5d yesssss Glad to see you're working on this again @MaximSokolov! |
Fixes #406 by using begin/end matching for ternary expressions
Fixes #279 by matching case statements only in switch block (replaces #405 fix)